#include "RSKTCN01.h"
#include "bsp_dma.h"
#include "ctrl_init.h"

void RSKTCN01_ASK(void)
{
	static uint8_t buff[8] = {0x03,0X03,0X00,0X00,0X00,0X02,0XC5,0XE9};
	send_data_dma_u6(buff,8);
}


void RSKTCN01_Data_Prase(uint8_t *buff)
{
	if(buff[0]==0x03 && buff[1] == 0x03 && buff[2] == 0x04)
	{
		CtrlPm.RSKTCN01.Data.Hum  = ((int16_t)(buff[3]<<8 | buff[4]))/10.0f;
		CtrlPm.RSKTCN01.Data.Temp = ((int16_t)(buff[5]<<8 | buff[6]))/10.0f;
	}
}


void RSKTCN01_Param_Config(void)
{
	CtrlPm.RSKTCN01.Fun.RSKTCN01_Data_Ask   = RSKTCN01_ASK;
	CtrlPm.RSKTCN01.Fun.RSKTCN01_Data_Prase = RSKTCN01_Data_Prase;
}



